package com.dp.bridge.exp01;

import java.math.BigDecimal;

/**
 * @Author: Ruomeng
 * @Date: 2024/11/29
 * @Description : design-pattern
 * 支付接口
 * @Version: 1.0
 */
public class PayController {

    /**
     * 模拟支付功能
     *
     * @param uid         用户id
     * @param tradeId     交易id
     * @param amount      交易金额
     * @param channelType 渠道类型 1微信 2支付宝
     * @param modeType    支付类型1密码 2人脸 3指纹
     * @return
     */
    public boolean doPay(String uid, String tradeId, BigDecimal amount, int channelType, int modeType) {
        // WeChat pay
        if (channelType == 1) {
            System.out.println("Wechat Pay Channel Start...");
            if (modeType == 1) {
                System.out.println("pay by password");
            } else if (modeType == 2){
                System.out.println("pay by face");
            } else if (modeType == 3){
                System.out.println("pay by finger");
            }
        }
        // AliPay
        if (channelType == 2) {
            System.out.println("AliPay Channel Start..");
            if (modeType == 1) {
                System.out.println("pay by password");
            } else if (modeType == 2){
                System.out.println("pay by face");
            } else if (modeType == 3){
                System.out.println("pay by finger");
            }
        }
        return true;
    }

}
